import request from '@/utils/request'

// 登录(管理员)
export function AdminLogin(username, password) {
  return request({
    url: 'auth/AdminLogin',
    method: 'post',
    data: {
      username,
      password
    }
  })
}

// 登录(普通用户)
export function login(email, password,code) {
  return request({
    url: 'auth/login',
    method: 'post',
    data: {
      email,
      password,
      code
    }
  })
}

// 普通用户注册
export function register(username, password, email) {
  return request({
    url: 'auth/register',
    method: 'post',
    data: {
      username,
      password,
      email
    }
  })
}

// 获取验证码
export function getCodeImg() {
  return request({
    url: 'auth/captcha',
    method: 'get'
  })
}